package archer.framework.file.config;

import archer.framework.file.ArcherFileModule;
import org.springframework.stereotype.Component;

/**
 * 文件服务配置
 *
 * @author christ
 * @date 2016/7/4
 */
@Component
public class FileRepositoryConfig {

    /**
     * 文件根目录
     */
    private String baseDir = ArcherFileModule.baseDir;

    /**
     * 可被公开访问的文件目录
     */
    private String publicDir = ArcherFileModule.publicDir;

    /**
     * 仅通过文件服务访问的目录
     */
    private String privateDir = ArcherFileModule.privateDir;

    /**
     * 可被公开访问文件资源的前缀
     */
    private String publicPrefix = ArcherFileModule.publicPrefix;

    /**
     * 仅通过文件服务访问的文件资源的前缀
     */
    private String privatePrefix = ArcherFileModule.privatePrefix;

    /**
     * 文件上传大小限制
     */
    private long maxSize = ArcherFileModule.maxSize;

    /**
     * 逻辑删除
     */
    private boolean logicalDelete = ArcherFileModule.logicalDelete;

    /**
     * 是否检测mime类型
     */
    public boolean detectMimeType =ArcherFileModule.detectMimeType;

    public String getBaseDir() {
        return baseDir;
    }

    public FileRepositoryConfig setBaseDir(String baseDir) {
        this.baseDir = baseDir;
        return this;
    }

    public String getPublicDir() {
        return publicDir;
    }

    public FileRepositoryConfig setPublicDir(String publicDir) {
        this.publicDir = publicDir;
        return this;
    }

    public String getPrivateDir() {
        return privateDir;
    }

    public FileRepositoryConfig setPrivateDir(String privateDir) {
        this.privateDir = privateDir;
        return this;
    }

    public String getPublicPrefix() {
        return publicPrefix;
    }

    public FileRepositoryConfig setPublicPrefix(String publicPrefix) {
        this.publicPrefix = publicPrefix;
        return this;
    }

    public String getPrivatePrefix() {
        return privatePrefix;
    }

    public FileRepositoryConfig setPrivatePrefix(String privatePrefix) {
        this.privatePrefix = privatePrefix;
        return this;
    }

    public long getMaxSize() {
        return maxSize;
    }

    public FileRepositoryConfig setMaxSize(long maxSize) {
        this.maxSize = maxSize;
        return this;
    }

    public boolean isLogicalDelete() {
        return logicalDelete;
    }

    public FileRepositoryConfig setLogicalDelete(boolean logicalDelete) {
        this.logicalDelete = logicalDelete;
        return this;
    }

    public boolean isDetectMimeType() {
        return detectMimeType;
    }

    public void setDetectMimeType(boolean detectMimeType) {
        this.detectMimeType = detectMimeType;
    }
}
